<!--
 * @Author: 花香蝶自来 1026583651@qq.com
 * @Date: 2024-04-16 18:35:31
 * @LastEditors: 花香蝶自来 1026583651@qq.com
 * @LastEditTime: 2024-05-29 20:01:23
 * @FilePath: /crm/components/formz/components/formselect.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <view class="">
    <u-form-item :label="item.label" borderBottom ref="item1" :prop="item.value"
      :borderBottom="item.iscard != 'after' && item.iscard != 'card'">
      <!-- <view @click="tap" style="flex: 1">{{ inputValue }}</view> -->
	  <view
	     @click="tap"
	  	style="flex: 1"
	    :class="[
	      (inputValue!=='请选择'||inputValue!=='请选择客户') ? 'uni-input-input' : 'select-wrap',
	    ]"
	    >{{ inputValue }}</view>
    </u-form-item>
    <orderIds0 ref="orderIds0" @change="change" v-model="orderIds"></orderIds0>
  </view>
</template>

<script>
import { getOrderListid } from "@/apis/order/index.js"
import orderIds0 from './orderIds0.vue';
export default {
  components: {
    orderIds0
  },
  data() {
    return {
      show: false,
      list: []
    };
  },

  props: {
    item: {
      typeof: Object,
      default: () => {
        return {};
      },
    },
    data: {
      typeof: Object,
      default: () => {
        return {};
      },
    },
    value: {
      typeof: [String, Number, Boolean, Array, Object],
      default: () => {
        return "";
      },
    },
  },
  computed: {
    orderIds: {
      get() {
        let str = this.value || ""
        return String(str).split(",").filter(e => {
          return e != ""
        })
      },
      set(v) {
        this.$emit('input', v)
      }
    },
    inputValue() {
      if (!this.data.customId || this.data.customId == "") {
        return "请选择客户"
      }
      return this.value || '请选择'
    }
  },
  watch: {
    // async orderIds() {
    //   if (this.orderIds.length == 0) {
    //     return
    //   }
    //   let list = []

    //   for (let i = 0; i < this.orderIds.length; i++) {
    //     let data = await getOrderListid(this.orderIds[i])
    //     data = data.records
    //     list = list.concat(data)
    //   }
    //   this.list = list;
    // }
  },
  methods: {
    tap() {
      if (!this.data.customId || this.data.customId == "") {
        uni.$u.toast("请选择客户")
        return
      }
      console.log();
      this.$refs.orderIds0.show(this.data)
    },
    change(e) {

    },
  },
};
</script>

<style scoped lang="scss">
  .uni-input-input {
	font-size: 14px!important;
	color: #171A1D!important;
	line-height: 99rpx!important;
	height: 99rpx!important; 
	padding-left: 10px;
  }
 .uni-forms-item__label {
   margin-left: 0;
   font-size: 14px!important;
   color: #171A1D!important;
   line-height: 99rpx!important;
   height: 99rpx!important;
 }
 .select-wrap {
   color:#C1C5C9;
   font-size:14px;
   line-height: 99rpx!important;
   height: 99rpx!important;
   padding-left: 10px;
 }
	
</style>

